<?php

namespace addons\zzyy;

use app\common\library\Menu;
use think\Addons;

/**
 * 插件
 */
class Zzyy extends Addons
{

    /**
     * 插件安装方法
     * @return bool
     */
    public function install()
    {
        $menu = [
            [
                'name' => 'zzyy',
                'title' => '自助预约',
                'icon' => 'fa fa-list',
                'sublist' =>
                    [
                        [
                            'name' => 'zzyy/store',
                            'title' => '门店设置',
                            'icon' => 'fa fa-code',
                            'remark' => '',
                            'weigh' => 21,
                            'sublist' =>
                                [
                                    [
                                        'name' => 'zzyy/store/index',
                                        'title' => '查看',
                                        'icon' => 'fa fa-circle-o',
                                        'weigh' => 0,
                                    ],
                                    [
                                        'name' => 'zzyy/store/add',
                                        'title' => '添加',
                                        'icon' => 'fa fa-circle-o',
                                        'weigh' => 0,
                                    ],
                                    [
                                        'name' => 'zzyy/store/edit',
                                        'title' => '编辑',
                                        'icon' => 'fa fa-circle-o',
                                        'weigh' => 0,
                                    ],
                                    [
                                        'name' => 'zzyy/store/del',
                                        'title' => '删除',
                                        'icon' => 'fa fa-circle-o',
                                        'weigh' => 0,
                                    ],
                                    [
                                        'name' => 'zzyy/store/multi',
                                        'title' => '批量更新',
                                        'icon' => 'fa fa-circle-o',
                                        'weigh' => 0,
                                    ],
                                ],
                        ],
                        [
                            'name' => 'zzyy/room',
                            'title' => '教室设置',
                            'icon' => 'fa fa-window-restore',
                            'remark' => '',
                            'weigh' => 20,
                            'sublist' =>
                                [
                                    [
                                        'name' => 'zzyy/room/index',
                                        'title' => '查看',
                                        'icon' => 'fa fa-circle-o',
                                        'weigh' => 0,
                                    ],
                                    [
                                        'name' => 'zzyy/room/add',
                                        'title' => '添加',
                                        'icon' => 'fa fa-circle-o',
                                        'weigh' => 0,
                                    ],
                                    [
                                        'name' => 'zzyy/room/edit',
                                        'title' => '编辑',
                                        'icon' => 'fa fa-circle-o',
                                        'weigh' => 0,
                                    ],
                                    [
                                        'name' => 'zzyy/room/del',
                                        'title' => '删除',
                                        'icon' => 'fa fa-circle-o',
                                        'weigh' => 0,
                                    ],
                                    [
                                        'name' => 'zzyy/room/multi',
                                        'title' => '批量更新',
                                        'icon' => 'fa fa-circle-o',
                                        'weigh' => 0,
                                    ],
                                ],
                        ],
                        [
                            'name' => 'zzyy/feature',
                            'title' => '特色设置',
                            'icon' => 'fa fa-file-powerpoint-o',
                            'remark' => '',
                            'weigh' => 18,
                            'sublist' =>
                                [
                                    [
                                        'name' => 'zzyy/feature/index',
                                        'title' => '查看',
                                        'icon' => 'fa fa-circle-o',
                                        'weigh' => 0,
                                    ],
                                    [
                                        'name' => 'zzyy/feature/add',
                                        'title' => '添加',
                                        'icon' => 'fa fa-circle-o',
                                        'weigh' => 0,
                                    ],
                                    [
                                        'name' => 'zzyy/feature/edit',
                                        'title' => '编辑',
                                        'icon' => 'fa fa-circle-o',
                                        'weigh' => 0,
                                    ],
                                    [
                                        'name' => 'zzyy/feature/del',
                                        'title' => '删除',
                                        'icon' => 'fa fa-circle-o',
                                        'weigh' => 0,
                                    ],
                                    [
                                        'name' => 'zzyy/feature/multi',
                                        'title' => '批量更新',
                                        'icon' => 'fa fa-circle-o',
                                        'weigh' => 0,
                                    ],
                                ],
                        ],
                        [
                            'name' => 'zzyy/setting/rentedit',
                            'title' => '预约全局设置',
                            'icon' => 'fa fa-circle-o',
                            'remark' => '',
                            'weigh' => 17,
                        ],
                        [
                            'name' => 'zzyy/roomclose',
                            'title' => '不开放时间设置',
                            'icon' => 'fa fa-wrench',
                            'remark' => '',
                            'weigh' => 17,
                            'sublist' =>
                                [
                                    [
                                        'name' => 'zzyy/roomclose/index',
                                        'title' => '查看',
                                        'icon' => 'fa fa-circle-o',
                                        'weigh' => 0,
                                    ],
                                    [
                                        'name' => 'zzyy/roomclose/add',
                                        'title' => '添加',
                                        'icon' => 'fa fa-circle-o',
                                        'weigh' => 0,
                                    ],
                                    [
                                        'name' => 'zzyy/roomclose/edit',
                                        'title' => '编辑',
                                        'icon' => 'fa fa-circle-o',
                                        'weigh' => 0,
                                    ],
                                    [
                                        'name' => 'zzyy/roomclose/del',
                                        'title' => '删除',
                                        'icon' => 'fa fa-circle-o',
                                        'weigh' => 0,
                                    ],
                                    [
                                        'name' => 'zzyy/roomclose/multi',
                                        'title' => '批量更新',
                                        'icon' => 'fa fa-circle-o',
                                        'weigh' => 0,
                                    ],
                                ],
                        ],
                        [
                            'name' => 'zzyy/user_extend',
                            'title' => '用户扩展信息',
                            'icon' => 'fa fa-user-circle',
                            'remark' => '',
                            'weigh' => 16,
                            'sublist' =>
                                [
                                    [
                                        'name' => 'zzyy/user_extend/index',
                                        'title' => '查看',
                                        'icon' => 'fa fa-circle-o',
                                        'weigh' => 0,
                                    ],
                                    [
                                        'name' => 'zzyy/user_extend/add',
                                        'title' => '添加',
                                        'icon' => 'fa fa-circle-o',
                                        'weigh' => 0,
                                    ],
                                    [
                                        'name' => 'zzyy/user_extend/edit',
                                        'title' => '编辑',
                                        'icon' => 'fa fa-circle-o',
                                        'weigh' => 0,
                                    ],
                                    [
                                        'name' => 'zzyy/user_extend/del',
                                        'title' => '删除',
                                        'icon' => 'fa fa-circle-o',
                                        'weigh' => 0,
                                    ],
                                    [
                                        'name' => 'zzyy/user_extend/multi',
                                        'title' => '批量更新',
                                        'icon' => 'fa fa-circle-o',
                                        'weigh' => 0,
                                    ],
                                ],
                        ],
                        [
                            'name' => 'zzyy/recharge_setting',
                            'title' => '充值金额设置',
                            'icon' => 'fa fa-money',
                            'remark' => '',
                            'weigh' => 14,
                            'sublist' =>
                                [
                                    [
                                        'name' => 'zzyy/recharge_setting/index',
                                        'title' => '查看',
                                        'icon' => 'fa fa-circle-o',
                                        'weigh' => 0,
                                    ],
                                    [
                                        'name' => 'zzyy/recharge_setting/add',
                                        'title' => '添加',
                                        'icon' => 'fa fa-circle-o',
                                        'weigh' => 0,
                                    ],
                                    [
                                        'name' => 'zzyy/recharge_setting/edit',
                                        'title' => '编辑',
                                        'icon' => 'fa fa-circle-o',
                                        'weigh' => 0,
                                    ],
                                    [
                                        'name' => 'zzyy/recharge_setting/del',
                                        'title' => '删除',
                                        'icon' => 'fa fa-circle-o',
                                        'weigh' => 0,
                                    ],
                                    [
                                        'name' => 'zzyy/recharge_setting/multi',
                                        'title' => '批量更新',
                                        'icon' => 'fa fa-circle-o',
                                        'weigh' => 0,
                                    ],
                                ],
                        ],
                        [
                            'name' => 'zzyy/reserve',
                            'title' => '预约管理',
                            'icon' => 'fa fa-btc',
                            'remark' => '',
                            'weigh' => 0,
                            'sublist' =>
                                [
                                    [
                                        'name' => 'zzyy/reserve/index',
                                        'title' => '查看',
                                        'icon' => 'fa fa-circle-o',
                                        'weigh' => 0,
                                    ],
                                    [
                                        'name' => 'zzyy/reserve/add',
                                        'title' => '添加',
                                        'icon' => 'fa fa-circle-o',
                                        'weigh' => 0,
                                    ],
                                    [
                                        'name' => 'zzyy/reserve/edit',
                                        'title' => '编辑',
                                        'icon' => 'fa fa-circle-o',
                                        'weigh' => 0,
                                    ],
                                    [
                                        'name' => 'zzyy/reserve/del',
                                        'title' => '删除',
                                        'icon' => 'fa fa-circle-o',
                                        'weigh' => 0,
                                    ],
                                    [
                                        'name' => 'zzyy/reserve/multi',
                                        'title' => '批量更新',
                                        'icon' => 'fa fa-circle-o',
                                        'weigh' => 0,
                                    ],
                                ],
                        ],
                        [
                            'name' => 'zzyy/transaction',
                            'title' => '交易查询',
                            'icon' => 'fa fa-reorder',
                            'remark' => '',
                            'weigh' => 0,
                            'sublist' =>
                                [
                                    [
                                        'name' => 'zzyy/transaction/index',
                                        'title' => '查看',
                                        'icon' => 'fa fa-circle-o',
                                        'weigh' => 0,
                                    ],
                                    [
                                        'name' => 'zzyy/transaction/add',
                                        'title' => '添加',
                                        'icon' => 'fa fa-circle-o',
                                        'weigh' => 0,
                                    ],
                                    [
                                        'name' => 'zzyy/transaction/edit',
                                        'title' => '编辑',
                                        'icon' => 'fa fa-circle-o',
                                        'weigh' => 0,
                                    ],
                                    [
                                        'name' => 'zzyy/transaction/del',
                                        'title' => '删除',
                                        'icon' => 'fa fa-circle-o',
                                        'weigh' => 0,
                                    ],
                                    [
                                        'name' => 'zzyy/transaction/multi',
                                        'title' => '批量更新',
                                        'icon' => 'fa fa-circle-o',
                                        'weigh' => 0,
                                    ],
                                ],
                        ],
                        [
                            'name' => 'zzyy/agreement',
                            'title' => '用户协议',
                            'icon' => 'fa fa-file',
                            'remark' => '',
                            'weigh' => 0,
                            'sublist' =>
                                [
                                    [
                                        'name' => 'zzyy/agreement/index',
                                        'title' => '查看',
                                        'icon' => 'fa fa-circle-o',
                                        'weigh' => 0,
                                    ],
                                    [
                                        'name' => 'zzyy/agreement/add',
                                        'title' => '添加',
                                        'icon' => 'fa fa-circle-o',
                                        'weigh' => 0,
                                    ],
                                    [
                                        'name' => 'zzyy/agreement/edit',
                                        'title' => '编辑',
                                        'icon' => 'fa fa-circle-o',
                                        'weigh' => 0,
                                    ],
                                    [
                                        'name' => 'zzyy/agreement/del',
                                        'title' => '删除',
                                        'icon' => 'fa fa-circle-o',
                                        'weigh' => 0,
                                    ],
                                    [
                                        'name' => 'zzyy/agreement/multi',
                                        'title' => '批量更新',
                                        'icon' => 'fa fa-circle-o',
                                        'weigh' => 0,
                                    ],
                                ],
                        ],
                    ],
            ],
        ];
        Menu::create($menu);
        return true;
    }

    /**
     * 插件卸载方法
     * @return bool
     */
    public function uninstall()
    {
        Menu::delete('zzyy');
        return true;
    }

    /**
     * 插件启用方法
     * @return bool
     */
    public function enable()
    {
        Menu::enable('zzyy');
        return true;
    }

    /**
     * 插件禁用方法
     * @return bool
     */
    public function disable()
    {
        Menu::disable('zzyy');
        return true;
    }

}
